package com.etooling.pdm.entity;


import com.etooling.framework.svo.AbstractEntity;
import lombok.Data;
import javax.persistence.*;

/**
 * 产品规格设置
 */
@Data
@Entity
@Table(name = "t_goods_prop_rename_rules", schema = "pdm")
public class GoodsPropRenameRules extends AbstractEntity {
    final public static String RENAME_IN_TYPE = "内部重命名";
    final public static String RENAME_OUT_TYPE = "外部重命名";

    GoodsType goodsType;//分类
    GoodsTypeProperties goodsTypeProperties;//使用命名的属性
    String fixedValue;//固定值,空就使用属性值
    String type; //重命名类型
    Integer seq;//顺序

    @ManyToOne(targetEntity = GoodsType.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "goods_type_id")
    public GoodsType getGoodsType() {
        return goodsType;
    }

    @ManyToOne(targetEntity = GoodsTypeProperties.class, fetch = FetchType.EAGER)
    @JoinColumn(name = "goods_type_prop_id")
    public GoodsTypeProperties getGoodsTypeProperties() {
        return goodsTypeProperties;
    }
}